[SEA] 파핑파핑 지뢰찾기 / ? / 50분#84
Open
TaeHeeLee0 wants to merge 2 commits into
Open
Conversation
처음에 문제를 잘못 이해해서 별의 개수처럼 덩어리만 구하면 될 줄 알았는데, 근처에 지뢰가 없어야만 가능하더군요. 따라서 근처에 지뢰가 있는지부터 확인 후, 없다면 덩어리로 열었습니다. 이후에 덩어리로 열지 못한 칸들을 열어 문제를 해결했습니다. 코드 자체는 bfs코드라서 어렵지 않게 짤 수 있었습니다.
Collaborator
|
*을 붙잡고 주변의 갯수를 늘리는 방식을 선택했는데 .을 잡고 주변의 지뢰 갯수를 세는 선택을 했군요. 저는 지뢰가 절반보다 적겠다고 생각해서 지뢰를 찾으면 주변에 +1을 해주는 식으로 진행했습니다. 또한 저는 0에서 한 껍질 더 탐색하는 것을 visited를 q에 안 넣더라도 true로 바꾸자고 했는데 그냥 탐색 코드를 사용하면 자연스럽게 풀리나보네요. 잘 봤습니다 :taechu: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
처음에 문제를 잘못 이해해서 별의 개수처럼 덩어리만 구하면 될 줄 알았는데, 근처에 지뢰가 없어야만 가능하더군요.
따라서 근처에 지뢰가 있는지부터 확인 후, 없다면 덩어리로 열었습니다. 이후에 덩어리로 열지 못한 칸들을 열어 문제를 해결했습니다.
코드 자체는 bfs코드라서 어렵지 않게 짤 수 있었습니다.